import { createRouter, createWebHistory } from 'vue-router'

const routes = [
    {
        path: '/',
        name: '',
        title: '首页',
        redirect: '/home',
    },
    {
        path: '/home',
        name: 'home',
        title: '首页',
        component: () => import('@/views/home/index.vue'), 
    },
    {
        path: '/article/:id',
        name: 'article',
        title: '文章',
        component: () => import('@/views/article/index.vue'),
    }
]

export default createRouter({
    history: createWebHistory(), // hash模式：createWebHashHistory，history模式：createWebHistory
    routes,
})